package com.kust.smarthome.web.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("找回密码封装类(通过邮箱验证找回)")
public class GetPasswordVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("邮箱")
    @NotBlank(message = "邮箱不能为空")
    private String email;

    @ApiModelProperty("验证码")
    @NotBlank(message = "验证码不能为空")
    @Pattern(regexp = "^.[4]$", message = "验证码为4位字符")
    private String code;

    @ApiModelProperty("密码1")
    @NotBlank(message = "密码1不能为空")
    private String password1;

    @ApiModelProperty("密码2")
    @NotBlank(message = "密码2不能为空")
    private String password2;
}
